﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HotelManageSystem.Models
{
    /// <summary>
    /// Class Name:     BiographyDetial
    /// Author:         Wangzx
    /// Creation Date:  2012-3-9
    /// Description:    显示员工的详细信息到Telerik的Grid当中用于筛选
    /// QA:             
    /// -----------------------------------------
    /// </summary>
    public class BiographyDetial
    {
        [Display(Name = "员工编号")]
        [Required(ErrorMessage = "必须输入员工编号")]
        [RegularExpression(@"^\d{1,9}$", ErrorMessage = "必须输入1-9位数字")]
        [Remote("CheckEmployeeId", "Biography", ErrorMessage = "员工编号已经存在")]
        public int ID { get; set; }

        [Display(Name = "员工姓名")]
        [Required(ErrorMessage = "必须输入员工姓名")]
        [StringLength(10, ErrorMessage = "姓名不能超过10个字符")]
        public string Name { get; set; }

        [Display(Name = "性别")]
        [StringLength(1, ErrorMessage = "性别不能超过1个字符")]
        public string Sex { get; set; }
        /********************************************************************/
        [Display(Name = "部门")]
        [Required(ErrorMessage = "必须选择一个部门,如果没有部门请先添加部门")]
        public int DepartmentId { get; set; }

        [Display(Name = "职位")]
        [Required(ErrorMessage = "必须选择一个职位,如果没有部门请先添加职位")]
        public int PostId { get; set; }

        [Display(Name = "学历")]
        [StringLength(8, ErrorMessage = "学历不能超过8个字符")]
        public string Degree { get; set; }
        /********************************************************************/
        [Display(Name = "出生日期")]
        [Required(ErrorMessage = "必须输入出生日期")]
        [DataType(DataType.Date, ErrorMessage = "必须输入时间")]
        public DateTime Birthday { get; set; }

        [Display(Name = "入职时间")]
        [Required(ErrorMessage = "必须输入入职时间")]
        [DataType(DataType.Date, ErrorMessage = "必须输入时间")]
        public DateTime JoinTime { get; set; }

        [Display(Name = "电话")]
        [RegularExpression(@"^\d{11}$", ErrorMessage = "电话号码为11个数字")]
        public string Telephone { get; set; }
        /********************************************************************/
        [Display(Name = "身份证号码")]
        [RegularExpression(@"^\d{14}(\d{1}|\d{4}|(\d{3}[xX]))$", ErrorMessage = "身份证格式不正确")]
        public string Identitycard { get; set; }

        [Display(Name = "毕业学校")]
        [StringLength(15, ErrorMessage = "不能超过15个字符")]
        public string Gradution { get; set; }

        [Display(Name = "籍贯")]
        [StringLength(6, ErrorMessage = "籍贯不能超过6个字符")]
        public string BirthPlace { get; set; }
        /********************************************************************/
        [Display(Name = "民族")]
        [StringLength(7, ErrorMessage = "民族不能超过7个字符")]
        public string Nationality { get; set; }

        [Display(Name = "政治面貌")]
        [StringLength(6, ErrorMessage = "不能超过6个字符")]
        public string Status { get; set; }

        [Display(Name = "现住址")]
        [StringLength(20, ErrorMessage = "不能超过20个字符")]
        public string PersentAddress { get; set; }
        /********************************************************************/
        [Display(Name = "户口所在地")]
        [StringLength(20, ErrorMessage = "不能超过20个字符")]
        public string HomeAddress { get; set; }

        [Display(Name = "邮编")]
        [StringLength(6, ErrorMessage = "邮编不能超过6个字符")]
        public string Zip { get; set; }

        [Display(Name = "员工状态")]
        public string EmployeeStatus { get; set; }

        [Display(Name = "试用天数")]
        [RegularExpression(@"^\+?[1-9][0-9]*$", ErrorMessage = "只能输入非零正整数")]
        [StringLength(2,ErrorMessage="长度不能超过两位")]
        public string ProbationDates { get; set; }
    }
}